/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.hpvas.gui.internalframe;

import edu.hpvas.control.OwnerController;
import edu.hpvas.control.Restrictions;
import edu.hpvas.persistence.entity.Person;
import java.awt.Color;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import org.eclipse.persistence.internal.oxm.schema.model.Restriction;

/**
 *
 * @author sony
 */
public class OwnerAddFrame extends javax.swing.JInternalFrame {

    Restrictions restrictions = new Restrictions();
    /**
     * Creates new form OwnerAddFrame
     */
    public OwnerAddFrame() {
        initComponents();
        dayJCB.setVisible(false);
        dayJL.setVisible(false);
        errorMJL.setVisible(false);
        caractersJL.setVisible(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        owner = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        monthJCB = new javax.swing.JComboBox();
        yearJCB = new javax.swing.JComboBox();
        lastNameJT = new javax.swing.JTextField();
        birthPlaceJT = new javax.swing.JTextField();
        nameJT = new javax.swing.JTextField();
        SSNJT = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        dayJL = new javax.swing.JLabel();
        dayJCB = new javax.swing.JComboBox();
        errorMJL = new javax.swing.JLabel();
        caractersJL = new javax.swing.JLabel();

        owner.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Owner", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP));

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel1.setText("Name:");

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel2.setText("Lastname: ");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel3.setText("BirthPlace");

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel4.setText("Birth Day:");

        jLabel5.setText("SSN:");

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel7.setText("Month");

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel8.setText("Year");

        monthJCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------", "January", "Febrary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", " " }));
        monthJCB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                monthJCBActionPerformed(evt);
            }
        });

        yearJCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "----", "2012", "2011", "2010", "2009", "2008", "2007", "2006", "2005", "2004", "2003", "2002", "2001", "2000", "1999", "1998", "1997", "1996", "1995", "1994", "1993", "1992", "1991", "1990", "1989", "1988", "1987", "1986", "1985", "1984", "1983", "1982", "1981", "1980", "1979", "1978", "1977", "1976", "1975", "1974", "1973", "1972", "1971", "1970", "1969", "1968", "1967", "1966", "1965", "1964", "1963", "1962", "1961", "1960", "1959", "1958", "1957", "1956", "1955", "1954", "1953", "1952", "1951", "1950", "1949", "1948", "1947", "1946", "1945", "1944", "1943", "1942", "1941", "1940", "1939", "1938", "1937", "1936", "1935", "1934", "1933", "1932", "1931", "1930", "1929", "1928", "1927", "1926", "1925", "1924", "1923", "1922", "1921", "1920" }));
        yearJCB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                yearJCBActionPerformed(evt);
            }
        });

        lastNameJT.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lastNameJTMouseClicked(evt);
            }
        });
        lastNameJT.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                lastNameJTKeyPressed(evt);
            }
        });

        birthPlaceJT.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                birthPlaceJTMouseClicked(evt);
            }
        });
        birthPlaceJT.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                birthPlaceJTKeyPressed(evt);
            }
        });

        nameJT.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                nameJTMouseClicked(evt);
            }
        });
        nameJT.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                nameJTKeyPressed(evt);
            }
        });

        SSNJT.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                SSNJTMouseClicked(evt);
            }
        });
        SSNJT.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                SSNJTKeyPressed(evt);
            }
        });

        jButton1.setText("Add");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        dayJL.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        dayJL.setText("Day");

        dayJCB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dayJCBActionPerformed(evt);
            }
        });

        errorMJL.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        errorMJL.setForeground(new java.awt.Color(204, 0, 0));
        errorMJL.setText("The date is Uncompleted");

        caractersJL.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        caractersJL.setForeground(new java.awt.Color(255, 0, 0));
        caractersJL.setText("The special caracters are not allowed... try again");

        javax.swing.GroupLayout ownerLayout = new javax.swing.GroupLayout(owner);
        owner.setLayout(ownerLayout);
        ownerLayout.setHorizontalGroup(
            ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ownerLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ownerLayout.createSequentialGroup()
                        .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(ownerLayout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(birthPlaceJT, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(ownerLayout.createSequentialGroup()
                                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel1))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(nameJT, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lastNameJT, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ownerLayout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(ownerLayout.createSequentialGroup()
                                        .addComponent(jLabel8)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(yearJCB, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLabel4))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(ownerLayout.createSequentialGroup()
                                        .addComponent(jLabel7)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(monthJCB, 0, 82, Short.MAX_VALUE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(dayJL))
                                    .addComponent(errorMJL, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(dayJCB, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(16, 16, 16))
                            .addGroup(ownerLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel5)
                                .addGap(18, 18, 18)
                                .addComponent(SSNJT, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ownerLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(caractersJL, javax.swing.GroupLayout.PREFERRED_SIZE, 292, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(114, 114, 114)
                        .addComponent(jButton1)
                        .addContainerGap())))
        );
        ownerLayout.setVerticalGroup(
            ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ownerLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel4)
                    .addComponent(nameJT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(errorMJL))
                .addGap(15, 15, 15)
                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jLabel8)
                    .addComponent(monthJCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(yearJCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(lastNameJT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dayJL)
                    .addComponent(dayJCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(birthPlaceJT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(SSNJT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                .addGroup(ownerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ownerLayout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ownerLayout.createSequentialGroup()
                        .addComponent(caractersJL)
                        .addGap(32, 32, 32))))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(owner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addComponent(owner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(42, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void nameJTKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTKeyPressed
        
    }//GEN-LAST:event_nameJTKeyPressed

    private void lastNameJTKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_lastNameJTKeyPressed
        
    }//GEN-LAST:event_lastNameJTKeyPressed

    private void birthPlaceJTKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_birthPlaceJTKeyPressed
        
    }//GEN-LAST:event_birthPlaceJTKeyPressed

    private void SSNJTKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_SSNJTKeyPressed
        
    }//GEN-LAST:event_SSNJTKeyPressed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        caractersJL.setVisible(false);
        if(nameJT.getText().isEmpty() || lastNameJT.getText().isEmpty() ||
                birthPlaceJT.getText().isEmpty() || SSNJT.getText().isEmpty()
                || yearJCB.getSelectedIndex()==0 || monthJCB.getSelectedIndex()==0
                || dayJCB.getSelectedIndex()==0){
            if(nameJT.getText().isEmpty()){
                nameJT.setText("The name cannot be blank");
                nameJT.setForeground(Color.red);
            }
            if(lastNameJT.getText().isEmpty()){
                lastNameJT.setText("The lastname cannot be blank");
                lastNameJT.setForeground(Color.red);
            }
            if(birthPlaceJT.getText().isEmpty()){
                birthPlaceJT.setText("The Birt Place cannot be blank");
                birthPlaceJT.setForeground(Color.red);
            }
            if(SSNJT.getText().isEmpty()){
                SSNJT.setText("The SSN cannot be blank");
                SSNJT.setForeground(Color.red);
            }
            if(yearJCB.getSelectedIndex()==0 || monthJCB.getSelectedIndex()==0
                || dayJCB.getSelectedIndex()==0){
                errorMJL.setVisible(true);
            }
        }
        else{
            if(nameJT.getText().equals("The name cannot be blank") ||
               lastNameJT.getText().equals("The lastname cannot be blank") ||
               birthPlaceJT.getText().equals("The Birt Place cannot be blank")||
               SSNJT.getText().equals("The SSN cannot be blank")){
                JOptionPane.showMessageDialog(this, "error, try Again");
            }
            else if(!restrictions.validateSpecialC(nameJT.getText())){
                System.out.println("oye mi perro me llevas a la u de las americas");
                caractersJL.setVisible(true);
            }
            else if(!restrictions.validateSpecialC(lastNameJT.getText())){
                caractersJL.setVisible(true);
            }
            else if(!restrictions.validateSpecialC(SSNJT.getText()))
            {
                caractersJL.setVisible(true);
            }
            else if(!restrictions.validateSpecialC(birthPlaceJT.getText())){
                caractersJL.setVisible(true);
            }
            else{
                Person person = new Person();
                person.setBirthPlace(birthPlaceJT.getText());
                person.setLastName(lastNameJT.getText());
                person.setName(nameJT.getText());
                person.setSsn(SSNJT.getText());
                int year = 113-yearJCB.getSelectedIndex() ;
                person.setBirthdate(new Date(year, monthJCB.getSelectedIndex()-1, dayJCB.getSelectedIndex()));
                OwnerController ownerController = new OwnerController();
                boolean result = ownerController.createOwner(person);
                if(result){
                    JOptionPane.showMessageDialog(this, "The Owner was created successfully");
                    clean();
                }
                errorMJL.setVisible(false);
            }
            errorMJL.setVisible(false);
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void SSNJTMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SSNJTMouseClicked
        if(SSNJT.getText().equals("The SSN cannot be blank")){
            SSNJT.setText("");
            SSNJT.setForeground(Color.black);
        }
    }//GEN-LAST:event_SSNJTMouseClicked

    private void birthPlaceJTMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_birthPlaceJTMouseClicked
        if(birthPlaceJT.getText().equals("The Birt Place cannot be blank")){
            birthPlaceJT.setText("");
            birthPlaceJT.setForeground(Color.black);
        }
    }//GEN-LAST:event_birthPlaceJTMouseClicked

    private void lastNameJTMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lastNameJTMouseClicked
        if(lastNameJT.getText().equals("The lastname cannot be blank")){
            lastNameJT.setText("");
            lastNameJT.setForeground(Color.black);
        }
    }//GEN-LAST:event_lastNameJTMouseClicked

    private void nameJTMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_nameJTMouseClicked
        if(nameJT.getText().equals("The name cannot be blank")){
            nameJT.setText("");
            nameJT.setForeground(Color.black);
        }
    }//GEN-LAST:event_nameJTMouseClicked

    private void yearJCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yearJCBActionPerformed
        errorMJL.setVisible(false);        
        dayJCB.setVisible(false);
        dayJL.setVisible(false);
        if(yearJCB.getSelectedIndex()!=0){
            if(monthJCB.getSelectedIndex()!=0){
                dayJCB.setVisible(true);
                dayJL.setVisible(true);
            }
        }
        monthSelected();
    }//GEN-LAST:event_yearJCBActionPerformed

    private void monthSelected(){
        int mes = monthJCB.getSelectedIndex();
        dayJCB.removeAllItems();
        dayJCB.addItem("--");
        if(mes ==1 || mes == 3 || mes == 5 || mes == 7 || mes ==8 || mes ==10 || mes == 12)
        {   
            for(int i=1; i<=31;i++)
            {
                dayJCB.addItem(i);
            }
        }
        else if(mes ==4 || mes ==6 || mes ==9 || mes ==11)
        {
            for(int i=1;i<=30;i++)
            {
                dayJCB.addItem(i);
            }
        }
        else if(mes ==2)
        {
            for(int i=1;i<=28;i++)
            {
                dayJCB.addItem(i);
            }
            if((2013-yearJCB.getSelectedIndex())%4 ==0)
            {
                dayJCB.addItem(29);
            }

        }
    }
    private void monthJCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_monthJCBActionPerformed
        errorMJL.setVisible(false);
        dayJCB.setVisible(false);
        dayJL.setVisible(false);
        monthSelected();
        if(monthJCB.getSelectedIndex()!=0){
            if(yearJCB.getSelectedIndex()!=0){
                dayJCB.setVisible(true);
                dayJL.setVisible(true);
            }
        }
    }//GEN-LAST:event_monthJCBActionPerformed

    private void dayJCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dayJCBActionPerformed
        errorMJL.setVisible(false);
    }//GEN-LAST:event_dayJCBActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField SSNJT;
    private javax.swing.JTextField birthPlaceJT;
    private javax.swing.JLabel caractersJL;
    private javax.swing.JComboBox dayJCB;
    private javax.swing.JLabel dayJL;
    private javax.swing.JLabel errorMJL;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JTextField lastNameJT;
    private javax.swing.JComboBox monthJCB;
    private javax.swing.JTextField nameJT;
    private javax.swing.JPanel owner;
    private javax.swing.JComboBox yearJCB;
    // End of variables declaration//GEN-END:variables

     public void clean() {
        nameJT.setText("");
        lastNameJT.setText("");
        birthPlaceJT.setText("");
        yearJCB.setSelectedIndex(0);
        monthJCB.setSelectedIndex(0);
        dayJCB.setVisible(false);
        dayJL.setVisible(false);
        SSNJT.setText("");
    }
}
